#pragma once
#include "stdafx.h"
#include "Handler.h"
#include "IEventHandler.h"
#include "ServiceHandler.h"
#include "IReactor.h"

template <typename T>
class IAcceptor : public IEventHandler<T>
{
public:
	IAcceptor(IReactor<T>* _reactor) :reactor(_reactor), stream() {}
	virtual void accept()
	{
		ServiceHandler<T>* service = makeServiceHandler();
		acceptServiceHandler(service);
	}
	void handle_event(Handler<T> handle, Event_Type et)
	{
		accept();
	}

protected:
	virtual ServiceHandler<T>* makeServiceHandler() = 0;
	virtual void acceptServiceHandler(ServiceHandler<T>*) = 0;

	IReactor<T>* reactor;
	SOCK_Stream stream;


};